package com.zyx.javademo.json;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.zyx.javademo.bean.User;

/**
 * @author Yaxi.Zhang
 * @since 2021/6/15 10:50
 * desc:
 */
public class JsonNullDemo {
    public static void main(String[] args) {
        User user = new User();
        user.setAge(18);
        System.out.println(user);
        String userJson = JSON.toJSONString(user);
        System.out.println(userJson);
        System.out.println(JSONObject.parseObject(userJson, User.class));
    }
}
